package com.iris.live.services.common.enumpack;

import org.apache.commons.codec.binary.StringUtils;

/**
 * Created by Gengshuai on 2017/12/28.
 */
public enum CompanyGroupEnum {

    LSH("LSH", "利星行", 1),

    LXH("LXH", "龙星行", 1),

    DCH("DCH", "大昌行", 2),

    LVD("LVD", "绿地", 2),

    JFU("JFU", "九福", 2),

    HHTD("HHTD", "宏和通达", 2),

    HEX("HEX", "和谐", 2),

    OTHER("OTHER", "其他", 2);

    private String code;

    private String description;
    //1：利星行为基础的版本 2：大昌行为基础的版本
    private Integer version;

    CompanyGroupEnum(String code, String description, Integer version) {
        this.code = code;
        this.description = description;
        this.version = version;
    }

    /**
     * 根据COMMAND获得详细描述
     *
     * @param command
     * @return
     */
    public static String getDesription(String command) {

        return "";
    }

    public static CompanyGroupEnum getCompanyGroupEnum(String code) {
        for (CompanyGroupEnum pushEnum : CompanyGroupEnum.values()) {
            if (StringUtils.equals(code, pushEnum.getCode())) {
                return pushEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return this.code + "，" + this.description;
    }
}